{include file="public/toper" /}
<div class="x-nav">
    <span class="layui-breadcrumb">
        <a href="">促销管理</a>
        <a href="">秒杀商品详情</a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">&#xe666;</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <div class="layui-form layui-col-md12 x-so">
            <input type="text" name="sreach" value=""  style="width:250px;" id="key"   placeholder="名称/用户" autocomplete="off" class="layui-input">
            <button class="layui-btn" id="search"><i class="layui-icon">&#xe615;</i></button>
        </div>
    </div>
    <xblock class="demoTable">
        <span class="layui-btn" ><a href="{:url('Gseckill/index')}" style="color: #fff">秒杀商品</a></span>
    </xblock>
    <table class="layui-hide" id="test" lay-filter="test"></table>
</div>
<script>
    layui.use(['table'], function(){
        var table = layui.table, $ = layui.jquery;
        var layer = layui.layer;
        var loading = layer.load(1, {shade: [0.1,'#fff'] });
        var tableIn = table.render({
            method: 'post',
            elem: '#test'
            ,url: "{:url('Gseckill/index2')}"
            ,id:'test'
            ,cols: [[
                {field:'killed_id', width:80, title: '序号',align: 'center',type:'numbers'}
                ,{field:'sname',width: 150,title: '名称', align: 'center'}
                ,{field:'spec_item', width:100, title: '规格',align: 'center',templet: function(d){if(d.spec_item==0){ return '无';}else{return d.spec_item;}}}
                ,{field:'uname', width:140, title: '秒杀用户',align: 'center'}
                ,{field:'state', width:100, title: '状态',align: 'center',templet: function(d){if(d.state==0){return '成功'; }else if(d.state==1){return '已付款';}else{return '无效';}}}
                ,{field: 'create_time',width: 180, align: 'center',sort:'true',title: '秒杀时间'}
            ]]
            ,page: true
            ,limit: 30
            ,limits:[30,60,90,120,150,180,210,240,270,300]
        });
        layer.close(loading);


        $('#search').on('click', function () {
            tableIn.reload({
                where: {key: $('#key').val()}
                ,page: {curr: 1 }
            });
        });
    });
</script>
{include file="public/footer"/}